#ifndef DOTFILE_HPP
#define DOTFILE_HPP
#include<fstream>
#include<sstream>
class DotFile {
private:
	std::string mFname;
	std::stringstream str;
	std::ofstream ofs;
public:
	DotFile(const std::string& fName):mFname(fName){
		str << "digraph G {" << std::endl;
		str << " node [fontname = \"Bitstream Vera Sans\", fontsize = 8,shape = \"record\"]" << std::endl;
		str << " edge [fontname = \"Bitstream Vera Sans\",fontsize = 8]" << std::endl;
	}
	void append(const std::string& s)
	{
		str << s;
	}
	~DotFile() {
		ofs.open(mFname);
		ofs << str.str() << std::endl << "}" << std::endl;
		ofs.close();
	}
};
#endif
